package com.yangbwe.Springtest;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Date;

public class SpringTest01 {
    @Test
    public void test01(){
        String config="beans.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(config);
        SpringService1 si = (SpringService1) applicationContext.getBean("springService1Imp");
        si.info();
        si.name();
        System.out.println(si);
    }

    @Test
    public void  test02(){
        String config="beans.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(config);
        Date si= (Date) applicationContext.getBean("mydate");
//        long time = si.getTime();
        System.out.println("时间是"+si);
    }
}
